var app = getApp();
Page({
  data: {
    data_url: "",
    userInfo: {},
    interation:'',
    state:0
  },
  callNum:function(e){
    wx.makePhoneCall({
      phoneNumber: '0871-67272014',
    })
  },
  in_click: function () {
    var that = this
    wx.request({
      url: app.globalData.data_url + '/GPD/getSignIn.do',
      data: {
        session_id: app.globalData.sessionId
      },
      success: function (res) {
        if (res.data.code == 0) {
          wx.showToast({
            title: res.data.massage,
          })
          that.setData({
            interation: res.data.interation,
            state: 1
          })
        } else {
          wx.showToast({
            title: res.data.massage,
            image: '/images/close.png'
          })
        }
      }
    })
  },
  onLoad: function (options) {
    var that = this;
    this.setData({
      data_url: app.globalData.data_url
    })
    wx.showLoading({
      title: '加载中',
    })
    wx.request({
      url: app.globalData.data_url + '/GPD/querySignInfo.do',
      data: {
        session_id: app.globalData.sessionId
      },
      success: function (res) {
        wx.hideLoading()
        that.setData({
          interation: res.data.interation,
          state: res.data.state
        })
      }
    })
    wx.getUserInfo({
      success: function (res) {
        that.setData({
          userInfo: res.userInfo,
        })
      },
    })
  }
})		